<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php echo $title; ?></title>
<base href="<?php echo $base; ?>" />
<link rel="stylesheet" type="text/css" href="view/stylesheet/stylesheet.css" />
<script type="text/javascript" src="<?php echo ROOT; ?>static/javascript/jquery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="<?php echo ROOT; ?>static/javascript/jquery/ui/jquery-ui-1.8.16.custom.min.js"></script>
<link type="text/css" href="<?php echo ROOT; ?>static/javascript/jquery/ui/themes/ui-lightness/jquery-ui-1.8.16.custom.css" rel="stylesheet" />
<script type="text/javascript" src="<?php echo ROOT; ?>static/javascript/jquery/superfish/js/superfish.js"></script>
</head>
<body>
<div id="container">
<div id="header">
  <div class="div1">
    <div class="div2"><a href="<?php echo UA('common/admincp'); ?>"><img src="view/image/logo.png"></a></div>
    <?php if ($logged) { ?>
    <div class="div3"><img src="view/image/lock.png" alt="" style="position: relative; top: 3px;" />&nbsp;<?php echo $logged; ?></div>
    <?php } ?>
  </div>
  <?php if ($logged) { ?>
  <div id="menu">
    <ul class="left" style="display: none;">
      <li id="dashboard"><a data-uri="<?php echo $home; ?>" class="top" data-id="dashboard"><?php echo $_['text_dashboard']; ?></a></li>
      <li id="catalog"><a class="top"><?php echo $_['text_catalog']; ?></a>
        <ul>
          <li><a data-uri="<?php echo UA('catalog/category'); ?>" data-id="catalog_category"><?php echo $_['text_category']; ?></a></li>
		  <li><a class="parent"><?php echo $_['text_product'];?></a>
          <ul><li><a data-uri="<?php echo UA('catalog/product'); ?>" data-id="catalog_product"><?php echo $_['text_product']; ?></a></li>
		  <li><a data-uri="<?php echo UA('catalog/product_group'); ?>" data-id="catalog_product_group"><?php echo $_['text_product_group']; ?></a></li>
		  <li><a data-uri="<?php echo UA('catalog/product_tpl'); ?>" data-id="catalog_product_tpl"><?php echo $_['text_product_template']; ?></a></li>
		  <li><a data-uri="<?php echo UA('catalog/specials'); ?>" data-id="catalog_specials"><?php echo $_['text_special']; ?></a></li>
		  <li><a data-uri="<?php echo UA('tool/collection'); ?>" data-id="catalog_collection"><?php echo $_['text_collection']; ?></a></li>
		  </ul></li>
          <li><a class="parent"><?php echo $_['text_attribute']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('catalog/attribute'); ?>" data-id="catalog_attribute"><?php echo $_['text_attribute']; ?></a></li>
              <li><a data-uri="<?php echo UA('catalog/attribute_group'); ?>" data-id="catalog_attribute_group"><?php echo $_['text_attribute_group']; ?></a></li>
            </ul>
          </li>
          <li><a data-uri="<?php echo UA('catalog/option'); ?>" data-id="catalog_option"><?php echo $_['text_option']; ?></a></li>
          <li><a data-uri="<?php echo UA('catalog/manufacturer'); ?>" data-id="catalog_manufacturer"><?php echo $_['text_manufacturer']; ?></a></li>
		  <li><a data-uri="<?php echo UA('catalog/supplier'); ?>" data-id="catalog_supplier"><?php echo $_['text_supplier']; ?></a></li>
          <li><a data-uri="<?php echo UA('catalog/download'); ?>" data-id="catalog_download"><?php echo $_['text_download']; ?></a></li>
          <li><a data-uri="<?php echo UA('catalog/review'); ?>" data-id="catalog_review"><?php echo $_['text_review']; ?></a></li>
          <li><a data-uri="<?php echo UA('catalog/faq'); ?>" data-id="catalog_faq"><?php echo $_['text_faq']; ?></a></li>
          <li><a data-uri="<?php echo UA('catalog/topic'); ?>" data-id="catalog_topic"><?php echo $_['text_topic']; ?></a></li>
          <li><a data-uri="<?php echo UA('catalog/page'); ?>" data-id="catalog_page"><?php echo $_['text_page']; ?></a></li>
        </ul>
      </li>
      <li id="extension"><a class="top"><?php echo $_['text_extension']; ?></a>
        <ul>
          <li><a data-uri="<?php echo UA('extension/module'); ?>" data-id="extension_module"><?php echo $_['text_module']; ?></a></li>
          <li><a data-uri="<?php echo UA('extension/shipping'); ?>" data-id="extension_shipping"><?php echo $_['text_shipping']; ?></a></li>
          <li><a data-uri="<?php echo UA('extension/payment'); ?>" data-id="extension_payment"><?php echo $_['text_payment']; ?></a></li>
          <li><a data-uri="<?php echo UA('extension/total'); ?>" data-id="extension_total"><?php echo $_['text_total']; ?></a></li>
          <li><a data-uri="<?php echo UA('extension/feed'); ?>" data-id="extension_feed"><?php echo $_['text_feed']; ?></a></li>
		  <li><a data-uri="<?php echo UA('tool/livechat'); ?>" data-id="tool_livechat"><?php echo $_['text_livechat']; ?></a></li>
        </ul>
      </li>
      <li id="sale"><a class="top"><?php echo $_['text_sale']; ?></a>
        <ul>
          <li><a data-uri="<?php echo UA('sale/order'); ?>" data-id="sale_order"><?php echo $_['text_order']; ?></a></li>
		  <li><a data-uri="<?php echo UA('sale/order_basket'); ?>" data-id="sale_order_basket"><?php echo $_['text_order_basket']; ?></a></li>
          <li><a data-uri="<?php echo UA('sale/return'); ?>" data-id="sale_return"><?php echo $_['text_return']; ?></a></li>
          <li><a class="parent"><?php echo $_['text_customer']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('sale/customer'); ?>" data-id="sale_customer"><?php echo $_['text_customer']; ?></a></li>
              <li><a data-uri="<?php echo UA('sale/customer_group'); ?>" data-id="sale_customer_group"><?php echo $_['text_customer_group']; ?></a></li>
              <li><a data-uri="<?php echo UA('sale/customer_grade'); ?>" data-id="sale_customer_grade"><?php echo $_['text_customer_grade']; ?></a></li>
              <li><a data-uri="<?php echo UA('sale/customer_ip'); ?>" data-id="sale_customer_ip"><?php echo $_['text_customer_ip']; ?></a></li>
              <li><a data-uri="<?php echo UA('sale/customer_blacklist'); ?>" data-id="sale_customer_blacklist"><?php echo $_['text_customer_blacklist']; ?></a></li>
            </ul>
          </li>
          <li><a data-uri="<?php echo UA('sale/affiliate'); ?>" data-id="sale_affiliate"><?php echo $_['text_affiliate']; ?></a></li>
          <li><a data-uri="<?php echo UA('sale/coupon'); ?>" data-id="sale_coupon"><?php echo $_['text_coupon']; ?></a></li>
          <li><a class="parent"><?php echo $_['text_voucher']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('sale/voucher'); ?>" data-id="sale_voucher"><?php echo $_['text_voucher']; ?></a></li>
              <li><a data-uri="<?php echo UA('sale/voucher_theme'); ?>" data-id="sale_voucher_theme"><?php echo $_['text_voucher_theme']; ?></a></li>
            </ul>
          </li>
          <li><a class="parent"><?php echo $_['text_mail']?></a>
          <ul>
	          <li><a data-uri="<?php echo UA('sale/mail'); ?>" data-id="sale_mail"><?php echo $_['text_mail']; ?></a></li>
	          <li><a data-uri="<?php echo UA('sale/mail_task'); ?>" data-id="sale_mail_task"><?php echo $_['text_mail_task']; ?></a></li>
	          <li><a data-uri="<?php echo UA('sale/mail_template'); ?>" data-id="sale_mail_template"><?php echo $_['text_mail_template']; ?></a></li>
          </ul>
          </li>
        </ul>
      </li>
      <li id="system"><a class="top"><?php echo $_['text_system']; ?></a>
        <ul>
          <li><a data-uri="<?php echo UA('setting/store'); ?>" data-id="setting_store"><?php echo $_['text_setting']; ?></a></li>
		  <li><a data-uri="<?php echo UA('setting/cache'); ?>" data-id="setting_cache"><?php echo $_['text_cache']; ?></a></li>		  
          <li><a class="parent"><?php echo $_['text_design']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('design/layout'); ?>" data-id="design_layout"><?php echo $_['text_layout']; ?></a></li>
              <li><a data-uri="<?php echo UA('design/banner'); ?>" data-id="design_banner"><?php echo $_['text_banner']; ?></a></li>
              <li><a data-uri="<?php echo UA('design/theme'); ?>" data-id="design_theme"><?php echo $_['text_theme']; ?></a></li>
            </ul>
          </li>		  
          <li><a class="parent"><?php echo $_['text_users']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('user/user'); ?>" data-id="user_user"><?php echo $_['text_user']; ?></a></li>
              <li><a data-uri="<?php echo UA('user/user_group'); ?>" data-id="user_user_group"><?php echo $_['text_user_group']; ?></a></li>
              <li><a data-uri="<?php echo UA('user/user_log'); ?>" data-id="user_user_log"><?php echo $_['text_user_log']; ?></a></li>
            </ul>
          </li>
          <li><a class="parent"><?php echo $_['text_localisation']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('localisation/language'); ?>" data-id="loc_language"><?php echo $_['text_language']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/currency'); ?>" data-id="loc_currency"><?php echo $_['text_currency']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/stock_status'); ?>" data-id="loc_stock_status"><?php echo $_['text_stock_status']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/order_status'); ?>" data-id="loc_order_status"><?php echo $_['text_order_status']; ?></a></li>
              <li><a class="parent"><?php echo $_['text_return']; ?></a>
                <ul>
                  <li><a data-uri="<?php echo UA('localisation/return_status'); ?>" data-id="loc_return_status"><?php echo $_['text_return_status']; ?></a></li>
                  <li><a data-uri="<?php echo UA('localisation/return_action'); ?>" data-id="loc_return_action"><?php echo $_['text_return_action']; ?></a></li>
                  <li><a data-uri="<?php echo UA('localisation/return_reason'); ?>" data-id="loc_return_reason"><?php echo $_['text_return_reason']; ?></a></li>
                </ul>
              </li>
			  <li><a data-uri="<?php echo UA('localisation/carrier'); ?>" data-id="loc_carrier"><?php echo $_['text_carrier']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/country'); ?>" data-id="loc_country"><?php echo $_['text_country']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/zone'); ?>" data-id="loc_zone"><?php echo $_['text_zone']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/geo_zone'); ?>" data-id="loc_geo_zone"><?php echo $_['text_geo_zone']; ?></a></li>
              <li><a class="parent"><?php echo $_['text_tax']; ?></a>
                <ul>
                  <li><a data-uri="<?php echo UA('localisation/tax_class'); ?>" data-id="loc_tax_class"><?php echo $_['text_tax_class']; ?></a></li>
                  <li><a data-uri="<?php echo UA('localisation/tax_rate'); ?>" data-id="loc_tax_rate"><?php echo $_['text_tax_rate']; ?></a></li>
                </ul>
              </li>
              <li><a data-uri="<?php echo UA('localisation/length_class'); ?>" data-id="loc_length_class"><?php echo $_['text_length_class']; ?></a></li>
              <li><a data-uri="<?php echo UA('localisation/weight_class'); ?>" data-id="loc_weight_class"><?php echo $_['text_weight_class']; ?></a></li>
            </ul>
          </li>
          <li><a data-uri="<?php echo UA('tool/error_log');; ?>" data-id="tool_error_log"><?php echo $_['text_error_log']; ?></a></li>
         <li><a class="parent"><?php echo $_['text_database'];?></a>
		 <ul>
			 <li><a data-uri="<?php echo UA('tool/backup'); ?>" data-id="tool_backup"><?php echo $_['text_backup']; ?></a></li>
			 <li><a data-uri="<?php echo UA('tool/export'); ?>" data-id="tool_export"><?php echo $_['text_export']; ?></a></li>
		  </ul>
		 </li>
		  <li><a data-uri="<?php echo UA('setting/seo_url'); ?>" data-id="setting_seo_url"><?php echo $_['text_seo_url']; ?></a></li>
		  <li><a class="parent"><?php echo $_['text_paypal_express']; ?></a>
			<ul>
			<li><a data-uri="<?php echo UA('sale/paypal_express'); ?>" data-id="sale_paypal_express">Sessions</a></li>
			<li><a data-uri="<?php echo UA('sale/paypal_express/payment'); ?>" data-id="sale_paypal_express_payment">Payments</a></li>
			<li><a data-uri="<?php echo UA('sale/paypal_express/error'); ?>" data-id="sale_paypal_express_error">Errors</a></li>
			</ul>
		  </li>
        </ul>
      </li>
      <li id="reports"><a class="top"><?php echo $_['text_reports']; ?></a>
        <ul>
          <li><a class="parent"><?php echo $_['text_sale']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('report/sale_order'); ?>" data-id="report_sale_order"><?php echo $_['text_report_sale_order']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/sale_tax'); ?>" data-id="report_sale_tax"><?php echo $_['text_report_sale_tax']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/sale_shipping'); ?>" data-id="report_sale_shipping"><?php echo $_['text_report_sale_shipping']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/sale_return'); ?>" data-id="report_sale_return"><?php echo $_['text_report_sale_return']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/sale_coupon'); ?>" data-id="report_sale_coupon"><?php echo $_['text_report_sale_coupon']; ?></a></li>
            </ul>
          </li>
          <li><a class="parent"><?php echo $_['text_product']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('report/product_viewed'); ?>" data-id="report_product_viewed"><?php echo $_['text_report_product_viewed']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/product_purchased'); ?>" data-id="report_product_purchased"><?php echo $_['text_report_product_purchased']; ?></a></li>
            </ul>
          </li>
          <li><a class="parent"><?php echo $_['text_customer']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('report/customer_online'); ?>" data-id="report_customer_online"><?php echo $_['text_report_customer_online']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/customer_order'); ?>" data-id="report_customer_order"><?php echo $_['text_report_customer_order']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/customer_reward'); ?>" data-id="report_customer_reward"><?php echo $_['text_report_customer_reward']; ?></a></li>
              <li><a data-uri="<?php echo UA('report/customer_credit'); ?>" data-id="report_customer_credit"><?php echo $_['text_report_customer_credit']; ?></a></li>
            </ul>
          </li>
          <li><a class="parent"><?php echo $_['text_affiliate']; ?></a>
            <ul>
              <li><a data-uri="<?php echo UA('report/affiliate_commission'); ?>" data-id="report_affiliate_commission"><?php echo $_['text_report_affiliate_commission']; ?></a></li>
            </ul>
          </li>
          <li><a data-uri="<?php echo UA('report/search_keyword')?>" data-id="report_search_keyword"><?php echo $_['text_search_keyword'];?></a></li>
        </ul>
      </li>
     
      <li id="help"><a class="top"><?php echo $_['text_help']; ?></a>
        <ul>
           <li id="article"><a class="parent"><?php echo $_['text_article']; ?></a>
	        <ul>
	          <li><a data-uri="<?php echo UA('article/category'); ?>" data-id="article_category"><?php echo $_['text_category']; ?></a></li>
	          <li><a data-uri="<?php echo UA('article/article'); ?>" data-id="article_article"><?php echo $_['text_article']; ?></a></li>
	        </ul>
	      </li>
          <li><a href="http://www.v5cart.com" target="_blank"><?php echo $_['text_v5cart']; ?></a></li>
          <li><a href="http://www.v5cart.com/document" target="_blank"><?php echo $_['text_documentation']; ?></a></li>
          <li><a href="http://forum.v5cart.com" target="_blank"><?php echo $_['text_support']; ?></a></li>
        </ul>
      </li>
    </ul>
    <ul class="right">
	  <li><a class="top">Server Time: <?php echo $service_time;?></a></li>
      <li id="store"><a href="<?php echo HTTP_CATALOG; ?>" target="_blank" class="top"><?php echo $_['text_front']; ?></a>
        <ul>
          <?php foreach ($stores as $store) { ?>
          <li><a href="<?php echo $store['href']; ?>" target="_blank"><?php echo $store['name']; ?></a></li>
          <?php } ?>
        </ul>
      </li>
      <li id="store"><a class="top" href="<?php echo UA('common/logout'); ?>"><?php echo $_['text_logout']; ?></a></li>
    </ul>
    <script type="text/javascript"><!--
$(document).ready(function() {
	$('#menu > ul').superfish({
		hoverClass	 : 'sfHover',
		pathClass	 : 'overideThisToUse',
		delay		 : 0,
		animation	 : {height: 'show'},
		speed		 : 'normal',
		autoArrows   : false,
		dropShadows  : false, 
		disableHI	 : false, /* set to true to disable hoverIntent detection */
		onInit		 : function(){},
		onBeforeShow : function(){},
		onShow		 : function(){},
		onHide		 : function(){}
	});
	
	$('#menu > ul').css('display', 'block');
});
 
function getURLVar(urlVarName) {
	var urlHalves = String(document.location).toLowerCase().split('?');
	var urlVarValue = '';
	
	if (urlHalves[1]) {
		var urlVars = urlHalves[1].split('&');

		for (var i = 0; i <= (urlVars.length); i++) {
			if (urlVars[i]) {
				var urlVarPair = urlVars[i].split('=');
				
				if (urlVarPair[0] && urlVarPair[0] == urlVarName.toLowerCase()) {
					urlVarValue = urlVarPair[1];
				}
			}
		}
	}
	
	return urlVarValue;
}

$(document).ready(function() {
	route = getURLVar('route');
	
	if (!route) {
		$('#dashboard').addClass('selected');
	} else {
		part = route.split('/');
		
		url = part[0];
		
		if (part[1]) {
			url += '/' + part[1];
		}
		
		$('a[href*=\'' + url + '\']').parents('li[id]').addClass('selected');
	}
});
//--></script> 
  </div>
  <?php } ?>
</div>
<div class="crumbs">
    <div class="options">
		<a href="javascript:;" title="Refresh" id="J_refresh" class="refresh" hidefocus="true">Refresh</a>
      	<a href="javascript:;" title="Full Screen" id="J_full_screen" class="admin_full" hidefocus="true">Full Screen</a>
	 </div>
	<div id="J_mtab" class="mtab">
	  <a href="javascript:;" id="J_prev" class="mtab_pre fl" title="Prev Tab">Prev Tab</a>
	  <a href="javascript:;" id="J_next" class="mtab_next fr" title="Next Tab">Next Tab</a>
		<div class="mtab_p">
	    <div class="mtab_b">
	       <ul id="J_mtab_h" class="mtab_h"><li class="current" data-id="dashboard"><span><a>Dashboard</a></span></li></ul>
	    </div>
	  </div>
	</div>
</div>
<div id="J_rframe" class="rframe_b">
 <iframe id="rframe_dashboard" src="<?php echo UA('common/home');?>" frameborder="0" scrolling="auto" style="height:100%;width:100%;"></iframe>
</div>
</div>
<script src="view/javascript/admincp.js"></script>
</body>
</html>